<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="搬砖 嵌入式">
<meta property="og:type" content="website">
<meta property="og:title" content="学无止境">
<meta property="og:url" content="http://example.com/page/24/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="搬砖 嵌入式">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="xudonglei">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/page/24/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/30/hexo%E5%8D%9A%E5%AE%A2%E7%AE%80%E5%8D%95%E5%8A%A0%E5%AF%86/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/30/hexo%E5%8D%9A%E5%AE%A2%E7%AE%80%E5%8D%95%E5%8A%A0%E5%AF%86/" class="post-title-link" itemprop="url">hexo博客简单加密</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-30 17:05:11" itemprop="dateCreated datePublished" datetime="2021-04-30T17:05:11+08:00">2021-04-30</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" itemprop="url" rel="index"><span itemprop="name">博客搭建</span></a>
                </span>
            </span>

          
            <span id="/2021/04/30/hexo%E5%8D%9A%E5%AE%A2%E7%AE%80%E5%8D%95%E5%8A%A0%E5%AF%86/" class="post-meta-item leancloud_visitors" data-flag-title="hexo博客简单加密" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/30/hexo%E5%8D%9A%E5%AE%A2%E7%AE%80%E5%8D%95%E5%8A%A0%E5%AF%86/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/30/hexo%E5%8D%9A%E5%AE%A2%E7%AE%80%E5%8D%95%E5%8A%A0%E5%AF%86/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    本文参考了网友的博客，原文地址为：<a target="_blank" rel="noopener" href="https://pgzxc.com/posts/a3837674.html%E3%80%82">https://pgzxc.com/posts/a3837674.html。</a></p>
<h2 id="1-概述"><a href="#1-概述" class="headerlink" title="1. 概述"></a>1. 概述</h2><p>​    Hexo编写Markdown文章后生成的静态页面默认是公开不加密的，所有人都可以访问，如果希望某些文章需要访问者只有输入正确的密码后才能继续访问，则需要使用插件：hexo-blog-encrypt。加密后的文章，一旦你输入了正确的密码，它将会被存储在本地浏览器的localStorage中。再次访问，不需要输入密码。</p>
<h2 id="2-安装encrypt插件"><a href="#2-安装encrypt插件" class="headerlink" title="2. 安装encrypt插件"></a>2. 安装encrypt插件</h2><p>​    在博客目录下执行下面的指令安装encrypt：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install --save hexo-blog-encrypt</span><br></pre></td></tr></table></figure>
<p>​    安装完成后，在package.json文件的dependecies依赖中看到encrypt插件：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&quot;dependencies&quot;: &#123;</span><br><span class="line">    &quot;hexo-blog-encrypt&quot;: &quot;^3.0.13&quot;,</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="3-加密设置"><a href="#3-加密设置" class="headerlink" title="3.加密设置"></a>3.加密设置</h2><p>​    将”password”字段添加到文章信息头部即可。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: WordPress站点之——博客搭建</span><br><span class="line">password: 1234</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/30/hello-world/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/30/hello-world/" class="post-title-link" itemprop="url">Hello World</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-30 15:35:39" itemprop="dateCreated datePublished" datetime="2021-04-30T15:35:39+08:00">2021-04-30</time>
            </span>

          
            <span id="/2021/04/30/hello-world/" class="post-meta-item leancloud_visitors" data-flag-title="Hello World" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/30/hello-world/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/30/hello-world/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          Here's something encrypted, password is required to continue reading.
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/04/30/hello-world/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/30/jetson%20nano%20L4T%20kernel%E7%BC%96%E8%AF%91/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/30/jetson%20nano%20L4T%20kernel%E7%BC%96%E8%AF%91/" class="post-title-link" itemprop="url">jetson nano L4T kernel编译</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-30 07:47:07" itemprop="dateCreated datePublished" datetime="2021-04-30T07:47:07+08:00">2021-04-30</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Jetson/" itemprop="url" rel="index"><span itemprop="name">Jetson</span></a>
                </span>
            </span>

          
            <span id="/2021/04/30/jetson%20nano%20L4T%20kernel%E7%BC%96%E8%AF%91/" class="post-meta-item leancloud_visitors" data-flag-title="jetson nano L4T kernel编译" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/30/jetson%20nano%20L4T%20kernel%E7%BC%96%E8%AF%91/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/30/jetson%20nano%20L4T%20kernel%E7%BC%96%E8%AF%91/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    本文参考链接如下所示：<a target="_blank" rel="noopener" href="https://blog.csdn.net/huiyuanliyan/article/details/92801541%EF%BC%8C%E5%AF%B9%E5%8E%9F%E4%BD%9C%E8%80%85%E8%A1%A8%E7%A4%BA%E6%9C%80%E5%B4%87%E9%AB%98%E7%9A%84%E6%95%AC%E6%84%8F%E5%92%8C%E6%84%9F%E8%B0%A2%E3%80%82">https://blog.csdn.net/huiyuanliyan/article/details/92801541，对原作者表示最崇高的敬意和感谢。</a></p>
<h2 id="1-什么是L4T"><a href="#1-什么是L4T" class="headerlink" title="1.  什么是L4T"></a>1.  什么是L4T</h2><p>​    L4T是Linux for Tegra的缩写，因为jetson系列用的是Tegra架构，因此L4T可以理解为jetson定制的Linux操作系统，具体的来说就是ubuntu定制款。</p>
<h2 id="2-为什么要编译内核"><a href="#2-为什么要编译内核" class="headerlink" title="2. 为什么要编译内核"></a>2. 为什么要编译内核</h2><p>​    通常来说编译内核的工作是为了客户基于jetson产品自己定制一些功能，比如增加一些硬件设备的驱动。</p>
<h2 id="3-内核源码和操作系统的关系"><a href="#3-内核源码和操作系统的关系" class="headerlink" title="3. 内核源码和操作系统的关系"></a>3. <strong>内核源码和操作系统的关系</strong></h2><p>​    简单来说我们使用的Linux操作系统是通过源码编译出来的，有写代码经验的朋友应该知道源码和可执行文件之间的关系，当然操作系统远比普通的可执行文件程序复杂，但可以用这个思路理解，所以如果你想要给你的系统增加底层的功能，你需要更改kernel源码，然后重新编译，然后把一些生成的文件刷进你当前的系统中，就实现了操作系统的更新。</p>
<h2 id="4-交叉编译环境搭建"><a href="#4-交叉编译环境搭建" class="headerlink" title="4.交叉编译环境搭建"></a>4.交叉编译环境搭建</h2><p>​    NVIDIA给我们提供了每个版本的源码文件，以及交叉编译工具，打开NVIDIA Jetson的下载中心：</p>
<p><a target="_blank" rel="noopener" href="https://developer.nvidia.com/embedded/downloads">https://developer.nvidia.com/embedded/downloads</a> ，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429213613.png" style="zoom:50%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429213758.png" style="zoom:50%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429214029.png" style="zoom:50%;">

<p>在自己的ubuntu机器上把这个交叉编译工具链配置好，这个比较简单，这边就略过了。对了，不要忘记安装gcc编译环境：sudo apt install build-essential bc</p>
<h2 id="5-内核源码解压和编译"><a href="#5-内核源码解压和编译" class="headerlink" title="5.内核源码解压和编译"></a>5.内核源码解压和编译</h2><p>​    把上面下载到的源码包解压缩：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429215111.png" style="zoom:50%;">

<p>进上面Linux_for_Tegra这个文件夹，里面会找到一个kernel_src.tbz2这个压缩包，这个就是源码压缩包了，把它再解压。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429215405.png" style="zoom:50%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429215745.png" style="zoom:50%;">

<p>​    目录下会出现kernel的文件夹，这个就是源码了。打开kernel会看到kernel-4.9, nvgpu, nvidia三个文件，kernel-4.9是Linux4.9的源码。</p>
<p>​    <strong>注意：后边所有的步骤要在一个terminal下完成！不要打开多个命令窗</strong></p>
<p>​    设置编译输出路径，这个目录将会存储你从kernel编译出来的所有内容，如我下图所示，执行$TKOUT是为了检查一下路径设置的对不对，显示…………………. is a directory，意味着你的路径设置成功了，其实这个主要是为了后边写make参数时更方便，所以用变量代替。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429220838.png" style="zoom:60%;">

<ul>
<li><p><strong>配置.config文件:</strong></p>
<p>sudo make ARCH=arm64 O=$TKOUT tegra_defconfig</p>
</li>
</ul>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429224227.png" style="zoom:60%;">

<p>​    成功后会提示你生成了.config文件，注意，tegra_defconfig在每个版本或者每个产品里叫法都不一样，TX2好像是tegra18_defconfig。</p>
<ul>
<li><p><strong>配置交叉编译变量</strong></p>
<p>export CROSS_COMPILE=/home/xdl/ToolChain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210429232626.png"></p>
</li>
<li><p><strong>编译内核</strong></p>
<p>sudo make  ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE O=$TKOUT -j4</p>
</li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/29/%E5%A4%84%E7%90%86JY-901%E5%BE%97%E5%88%B0%E7%9A%84%E6%8C%AF%E5%8A%A8%E6%95%B0%E6%8D%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/29/%E5%A4%84%E7%90%86JY-901%E5%BE%97%E5%88%B0%E7%9A%84%E6%8C%AF%E5%8A%A8%E6%95%B0%E6%8D%AE/" class="post-title-link" itemprop="url">处理JY-901得到的振动数据</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-29 11:11:16" itemprop="dateCreated datePublished" datetime="2021-04-29T11:11:16+08:00">2021-04-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2021/04/29/%E5%A4%84%E7%90%86JY-901%E5%BE%97%E5%88%B0%E7%9A%84%E6%8C%AF%E5%8A%A8%E6%95%B0%E6%8D%AE/" class="post-meta-item leancloud_visitors" data-flag-title="处理JY-901得到的振动数据" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/29/%E5%A4%84%E7%90%86JY-901%E5%BE%97%E5%88%B0%E7%9A%84%E6%8C%AF%E5%8A%A8%E6%95%B0%E6%8D%AE/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/29/%E5%A4%84%E7%90%86JY-901%E5%BE%97%E5%88%B0%E7%9A%84%E6%8C%AF%E5%8A%A8%E6%95%B0%E6%8D%AE/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    JY901是9轴加速度计，有加速度，角加速度，时间，磁场等参数都能输出，我这边只让他输出三轴的加速度，并借此数据分析振动。JY901的上位机可以把采集到的数据保存到txt文件中，采集保存的频率可以选择，我这边选择200Hz。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424093422.png" style="zoom:40%;">

<p>​    保存下来的txt文件中的数据如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424093639.png" style="zoom:50%;">

<p>​    为了方便后面python的处理，把最开始的两行手动删掉，只留下面的内容。下面是解析txt文件中的数据，把加速度数据显示出来，并做FFT处理，显示频率最高的那个频点。上代码：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> scipy.fftpack <span class="keyword">as</span> fftpack</span><br><span class="line"><span class="keyword">from</span> scipy <span class="keyword">import</span> signal</span><br><span class="line"></span><br><span class="line">fs = <span class="number">200</span>            <span class="comment"># 采样频率200Hz</span></span><br><span class="line">acc_x = []</span><br><span class="line">acc_y = []</span><br><span class="line">acc_z = []</span><br><span class="line"><span class="keyword">with</span> <span class="built_in">open</span>(<span class="string">&quot;210424084054.txt&quot;</span>, <span class="string">&#x27;r&#x27;</span>, encoding=<span class="string">&#x27;utf-8&#x27;</span>) <span class="keyword">as</span> f:</span><br><span class="line">    <span class="keyword">while</span> <span class="literal">True</span>:</span><br><span class="line">        line = f.readline()</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> line:  <span class="comment"># 读完就返回</span></span><br><span class="line">            <span class="keyword">break</span></span><br><span class="line">        line = line.split()</span><br><span class="line">        acc_x.append(<span class="built_in">float</span>(line[<span class="number">2</span>]))</span><br><span class="line">        acc_y.append(<span class="built_in">float</span>(line[<span class="number">3</span>]))</span><br><span class="line">        acc_z.append(<span class="built_in">float</span>(line[<span class="number">4</span>]))</span><br><span class="line">    N = <span class="built_in">len</span>(acc_x)</span><br><span class="line"></span><br><span class="line">    accx_fft = fftpack.fft(acc_x)  <span class="comment"># 做FFT</span></span><br><span class="line">    m_accx = np.<span class="built_in">abs</span>(accx_fft)</span><br><span class="line"></span><br><span class="line">    accy_fft = fftpack.fft(acc_y)</span><br><span class="line">    m_accy = np.<span class="built_in">abs</span>(accy_fft)</span><br><span class="line"></span><br><span class="line">    accz_fft = fftpack.fft(acc_z)</span><br><span class="line">    m_accz = np.<span class="built_in">abs</span>(accz_fft)</span><br><span class="line">    freq_fft = fftpack.fftfreq(N, d=<span class="number">1</span> / fs)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">1</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc x&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;time&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;g&#x27;</span>)</span><br><span class="line">    plt.plot(acc_x)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">2</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc y&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;time&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;g&#x27;</span>)</span><br><span class="line">    plt.plot(acc_y)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">3</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc z&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;time&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;g&#x27;</span>)</span><br><span class="line">    plt.plot(acc_z)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc x fft&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;frequency&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;power&#x27;</span>)</span><br><span class="line">    plt.stem(freq_fft, m_accx)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc y fft&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;frequency&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;power&#x27;</span>)</span><br><span class="line">    plt.stem(freq_fft, m_accy)</span><br><span class="line"></span><br><span class="line">    plt.subplot(<span class="number">2</span>, <span class="number">3</span>, <span class="number">6</span>)</span><br><span class="line">    plt.title(<span class="string">&#x27;acc z fft&#x27;</span>)</span><br><span class="line">    plt.xlabel(<span class="string">&#x27;frequency&#x27;</span>)</span><br><span class="line">    plt.ylabel(<span class="string">&#x27;power&#x27;</span>)</span><br><span class="line">    plt.stem(freq_fft, m_accz)</span><br><span class="line"></span><br><span class="line">    plt.tight_layout()</span><br><span class="line">    plt.show()</span><br></pre></td></tr></table></figure>
<ul>
<li><p>模块静止时的效果：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424094649.png" style="zoom:67%;">
</li>
<li><p>轻微振动</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424094923.png"></p>
</li>
<li><p>再剧烈振动一些</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424100344.png"></p>
</li>
</ul>
<p>另外还可以利用短时傅里叶变换来看时频图，上代码：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">fs = <span class="number">200</span>  <span class="comment">#采样率为200Hz</span></span><br><span class="line">acc_y_array = np.array(acc_y)</span><br><span class="line">Block_size = <span class="number">256</span></span><br><span class="line">freqs, times, Sxx = signal.spectrogram(acc_y_array, fs=fs, window=<span class="string">&#x27;hanning&#x27;</span>,</span><br><span class="line">                                       nperseg=Block_size, noverlap=<span class="number">0.5</span> * Block_size,</span><br><span class="line">                                       detrend=<span class="literal">False</span>, scaling=<span class="string">&#x27;spectrum&#x27;</span>)</span><br><span class="line">plt.figure()</span><br><span class="line">plt.pcolormesh(times, freqs, <span class="number">20</span> * np.log10(Sxx / <span class="number">1e-06</span>), cmap=<span class="string">&#x27;inferno&#x27;</span>)</span><br><span class="line">plt.colorbar()</span><br><span class="line">plt.ylabel(<span class="string">&#x27;Frequency [Hz]&#x27;</span>)</span><br><span class="line">plt.xlabel(<span class="string">&#x27;Time [s]&#x27;</span>)</span><br></pre></td></tr></table></figure>
<p>​    rate就是采样频率，我们的采样频率为200Hz。<br>​    hanning就是选择对数据加汉宁窗。<br>​    Block_size为区块大小，即在时域上每采样256个点就算作一个区块，然后对这个区块进行FFT变换。之后再采样下个区块，然后再进行FFT变换。<br>​    noverlap是重叠。举个列子，第一个区块是时间序列从0到采集256个点后进行FFT变换的，然后开始计算第二个区块，这个第二个区块和第一个区块有50%的重叠，即是从第128个点开始采集，再数256个点后进行FFT变换。这样做的好处是可以对时域上采集的数据不断进行平均，得出的时频变换结果准确性会更高。</p>
<p><strong>返回值</strong>：<br>    freqs:频域信息<br>    times:时域信息<br>    Sxx:时频图</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210424104610.png" style="zoom:50%;">
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/29/jetson%20nano%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E7%83%A7%E5%86%99/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/29/jetson%20nano%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E7%83%A7%E5%86%99/" class="post-title-link" itemprop="url">jetson nano系统镜像烧写</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-29 11:11:14" itemprop="dateCreated datePublished" datetime="2021-04-29T11:11:14+08:00">2021-04-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Jetson/" itemprop="url" rel="index"><span itemprop="name">Jetson</span></a>
                </span>
            </span>

          
            <span id="/2021/04/29/jetson%20nano%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E7%83%A7%E5%86%99/" class="post-meta-item leancloud_visitors" data-flag-title="jetson nano系统镜像烧写" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/29/jetson%20nano%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E7%83%A7%E5%86%99/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/29/jetson%20nano%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E7%83%A7%E5%86%99/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="1-镜像下载"><a href="#1-镜像下载" class="headerlink" title="1.  镜像下载"></a>1.  镜像下载</h2><p>​    NVIDIA官方为Jetson Nano Developer Kit (后面统称为Jetson Nano了）提供了SD卡版本的系统镜像，虽然nvidia也提供了用SDK Manager法烧写的方式，但是用SD卡烧写肯定方便很多，因此这成了很多初学者的首选。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210428233613.png" style="zoom:80%;">

<p>​    打开NVIDIA Jetson的下载中心<a target="_blank" rel="noopener" href="https://developer.nvidia.com/embedded/downloads">https://developer.nvidia.com/embedded/downloads</a> ，截至写这篇文章为止，官网提供的SD卡镜像版本号为4.5.1。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210428233904.png" style="zoom:67%;">

<p>直接下载第二个即可。</p>
<h2 id="2-TF卡格式化"><a href="#2-TF卡格式化" class="headerlink" title="2. TF卡格式化"></a>2. TF卡格式化</h2><p>​    一般情况下，如果你手上的卡是新的，可以直接烧写，但是如果是之前用过的卡，这种时候就需要预先对SD卡做一下格式化，避免在镜像过程中出错。这里我们可以使用一个<a target="_blank" rel="noopener" href="http://www.waveshare.net/w/upload/d/d7/Panasonic_SDFormatter.zip">SDFormatter.exe软件</a></p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210428234332.png" style="zoom:50%;">

<h2 id="3-镜像烧写"><a href="#3-镜像烧写" class="headerlink" title="3. 镜像烧写"></a>3. 镜像烧写</h2><p>​    使用Win32DiskImager，按照下图进行配置：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210428235007.png" style="zoom:67%;">

<p>​    点击写入开始烧录，此时会弹出一个确认框，单击“Yes” 继续下一步即可（若报错，则有可能是镜像文件所在的路径有中文，需要把其移动到没有中文的路径下）。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/29/windows%E5%AE%89%E8%A3%85Anaconda%E5%BC%80%E5%8F%91python/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/29/windows%E5%AE%89%E8%A3%85Anaconda%E5%BC%80%E5%8F%91python/" class="post-title-link" itemprop="url">windows安装Anaconda开发python</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-29 11:11:14" itemprop="dateCreated datePublished" datetime="2021-04-29T11:11:14+08:00">2021-04-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2021/04/29/windows%E5%AE%89%E8%A3%85Anaconda%E5%BC%80%E5%8F%91python/" class="post-meta-item leancloud_visitors" data-flag-title="windows安装Anaconda开发python" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/29/windows%E5%AE%89%E8%A3%85Anaconda%E5%BC%80%E5%8F%91python/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/29/windows%E5%AE%89%E8%A3%85Anaconda%E5%BC%80%E5%8F%91python/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="一-为什么要使用anaconda"><a href="#一-为什么要使用anaconda" class="headerlink" title="一.为什么要使用anaconda"></a>一.为什么要使用anaconda</h2><p>​    比如你要用python做图像处理，你可能会使用scikit-image包。因为scikit-image是基于scipy进行运算的，因此安装numpy和scipy是肯定的。要进行图片的显示，还需要安装matplotlib包，综合起来，需要的包有好几个，并且每种包对版本可能又有要求，安装起来非常费事，尤其是scipy，在windows上基本安装不上。</p>
<p>​    但是不用怕，我们选择一款集成安装环境就行了，在此推荐Anaconda, 它把以上需要的包都集成在了一起，因此我们实际上从头到尾只需要安装Anaconda软件就行了，其它什么都不用装。</p>
<h2 id="二-windows10安装anaconda"><a href="#二-windows10安装anaconda" class="headerlink" title="二. windows10安装anaconda"></a>二. windows10安装anaconda</h2><p>​    去这个网址：<a target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/%E4%B8%8B%E8%BD%BD%E4%BC%9A%E6%AF%94%E8%BE%83%E5%BF%AB%E3%80%82%E5%81%87%E8%AE%BE%E4%BD%A0%E6%83%B3%E5%AE%89%E8%A3%85python3.6.5%EF%BC%8C%E9%82%A3%E4%B9%88anaconda3-5.2.0%E5%B0%B1%E6%98%AF%E4%BD%A0%E9%9C%80%E8%A6%81%E4%B8%8B%E8%BD%BD%E7%9A%84%E5%8C%85%E3%80%82%E5%AE%89%E8%A3%85anaconda%E7%9A%84%E6%97%B6%E5%80%99%E5%AE%83%E4%BC%9A%E9%A1%BA%E5%B8%A6%E5%B8%AE%E4%BD%A0%E6%8A%8Apython%E7%BB%99%E5%AE%89%E8%A3%85%E4%BA%86%E3%80%82">https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/下载会比较快。假设你想安装python3.6.5，那么anaconda3-5.2.0就是你需要下载的包。安装anaconda的时候它会顺带帮你把python给安装了。</a></p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210423210911.png" style="zoom:50%;">

<p>​    在“Advanced Installation Options”中不要勾选“Add Anaconda to my PATH environment variable.”（“添加Anaconda至我的环境变量。”）。因为如果勾选，则将会影响其他程序的使用。如果使用Anaconda，则通过打开Anaconda Navigator或者在开始菜单中的“Anaconda Prompt”（类似macOS中的“终端”）中进行使用。   </p>
<p>​    除非你打算使用多个版本的Anaconda或者多个版本的Python，否则便勾选“Register Anaconda as my default Python 3.6”。   </p>
<p>​    验证安装是否成功：“开始 → Anaconda3（64-bit）→ 右键点击Anaconda Prompt → 以管理员身份运行”，在Anaconda Prompt中输入 conda list ，可以查看已经安装的包名和版本号。若结果可以正常显示，则说明安装成功。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210423211211.png" style="zoom:57%;">

<p>​    输入conda list 就可以查询现在安装了哪些库，常用的numpy, scipy名列其中。如果你还有什么包没有安装上，可以运行 : conda install *  来进行安装。（*为需要的包的名称）   </p>
<p>​    如果某个包版本不是最新的，运行 conda update *** 就可以更新了。   我发现在cmd中运行时使用的的原来的python版本，并且此版本的python与anaconda中的是相互隔离的：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210423211402.png" style="zoom:67%;">

<p>​    【pip install 库名VScondainstall 库名】   </p>
<p>​    1.pip是从PyPI上直接下载，他仅仅是简单地下载而已，不能包含某些包必要的依赖文件   </p>
<p>​    2.Conda没有语言限制，可以构建和管理任何语言的任何类型的软件，这其中也包括Python。conda旨在管理任何软件堆栈中的包和依赖关系，其安装过程中，会提示哪些包与当前所要安装的包之间有依赖关系，并且会自动安装和更新，用起来会更靠谱。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/26/MM32F103%E4%B8%8A%E5%88%86%E6%9E%90usb%E7%9A%84%E6%9E%9A%E4%B8%BE%E8%BF%87%E7%A8%8B%E6%80%BB/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/26/MM32F103%E4%B8%8A%E5%88%86%E6%9E%90usb%E7%9A%84%E6%9E%9A%E4%B8%BE%E8%BF%87%E7%A8%8B%E6%80%BB/" class="post-title-link" itemprop="url">MM32F103上分析usb的枚举过程总</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-26 16:53:10" itemprop="dateCreated datePublished" datetime="2021-04-26T16:53:10+08:00">2021-04-26</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2021/04/26/MM32F103%E4%B8%8A%E5%88%86%E6%9E%90usb%E7%9A%84%E6%9E%9A%E4%B8%BE%E8%BF%87%E7%A8%8B%E6%80%BB/" class="post-meta-item leancloud_visitors" data-flag-title="MM32F103上分析usb的枚举过程总" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/26/MM32F103%E4%B8%8A%E5%88%86%E6%9E%90usb%E7%9A%84%E6%9E%9A%E4%B8%BE%E8%BF%87%E7%A8%8B%E6%80%BB/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/26/MM32F103%E4%B8%8A%E5%88%86%E6%9E%90usb%E7%9A%84%E6%9E%9A%E4%B8%BE%E8%BF%87%E7%A8%8B%E6%80%BB/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    最近在调试灵动微MM32F103CBT6上的usb从机，官方提供了demo例程，看它的代码量并不多，因此想通过这款mcu，从头开始借助代码具体分析一下usb的枚举过程。之所以想分析枚举过程，原因很简单：因为它重要！！！枚举就是从设备读取一些信息，知道设备是什么样的设备，如何进行通信，这样主机就可以根据这些信息来加载合适的驱动程序。调试USB设备，很重要的一点就是USB的枚举过程，只要枚举成功了，那么就已经成功大半了。</p>
<p>​    USB的枚举是：主机以控制传输的方式，通过端点 0 对设备发送各种请求，设备收到主机发来的请求后回复相应的信息，进行枚举操作。这边着重介绍一下控制传输的概念，因为控制传输同样非常重要。</p>
<p>​    控制传输有三个过程：</p>
<ul>
<li>1个setup事务   (建立过程)</li>
<li>0个或多个in/out事务   (数据过程)</li>
<li>1个in/out事务    (状态过程)</li>
</ul>
<p>另外有一点要记住：事务是由令牌包Token packet、数据包Data packet、握手包Handshack packet组成的。</p>
<p>​    通过看usb抓包工具出来的数据，会对这个过程以及数据包有比较直观的感受，如下图所示：</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/10210125224201877.png"></p>
<p>​    这个图中就是一个完整的控制传输，看第一行绿色开头的那个Transfer即可知：这是一次完整的传输，第一行红色那边为Control，就知道这次完整的传输是控制传输。</p>
<p>​    图中的三个阶段就是上面提到的建立过程、数据过程和状态过程。</p>
<p>​    图中的第二阶段就是3个in 事务，事务是Transaction。之前不是也说了嘛：事务是由令牌包Token packet、数据包Data packet、握手包Handshack packet组成的。图中第二阶段的第一个in事务展开了：显示下面三行黄色开头的部分，即那三种包。</p>
<br>

<p>​    枚举过程大致有三个来回：</p>
<ul>
<li>主机发起第一个控制传输。主机发出获取设备描述符的输入请求，设备收到该请求后，在数据过程将设备描述符返回给主机。主机在成功获取到一个数据包的设备描述符后并且确认没有什么错误后，就会返回一个0长度的状态数据包给设备。</li>
<li>第二个来回：设置地址。这时USB主机发出一个设置地址的请求（建立过程，设置地址无数据过程），地址包含在建立包中，具体的地址USB主机会负责管理。USB设备在收到地址后，返回0长度的状态包，主机收到0长度的状态包之后，会返回一个ACK给设备。设备在收到这个ACK之后，就可以启用新的地址了。这样设备就分配到了一个唯一的设备地址，以后主机就通过它来进行访问该设备。</li>
<li>第三个来回：主机使用新地址获取完整的设备描述符。这次跟第一次可能有点不一样，这次需要获取完全部的18个字节的设备描述符。当然，如果你的端点0缓冲大于18字节的话，那就跟第一次的情形一样了。</li>
</ul>
<br>

<p>​    这边再补充一个知识点，内容来源于csdn，原文地址为：<a target="_blank" rel="noopener" href="https://blog.csdn.net/mcgrady_tracy/article/details/24650351">https://blog.csdn.net/mcgrady_tracy/article/details/24650351</a></p>
<p><strong>linux初次获取USB设备描述符策略问题：</strong></p>
<p>​    每个USB设备都有个控制端点，用于在枚举过程中同USB Host进行通信，例如，读取设备描述符、分配地址等等…，都是通过端点0来完成的。对于端点来说，它都具有个发送或接收数据包的最大值，对于普通端点来说，它都在端点描述符中的wMaxPacketSize中被定义，但是端点0没有端点描述符，那么它就定义在USB设备描述符中的bMaxPacketSize0中。如果要和端点0进行通信，那么首先应该得到bMaxPakcetSize0这个值，但是没有通信如何得到这个值，难道进入了一个死循环？</p>
<p>​    我们都知道，对于低速设备来说，端点0的最大数据包长度为8字节，对于全速设备来说，可以8、16、32、或64字节，对于高速设备来说，只能是64字节，也就说端点0的最大数据包长度至少为8，<strong>而通过设备描述符发现，bMaxPacketSize0刚好定义在8字节处，也就是说可以先读取8字节的设备描述符，从而得到了bMaxPacketSize0这个值</strong>，那么以后的传输就可以按照最大数据包长度这个值来进行传输。Linux也正是按照这个策略来的。</p>
<p>​    但是有的USB设备并不这样，在你获取8字节的设备描述符的时候它会将18字节的设备描述符全部返回给你，这样就可能会导致错误，但是在Windows下不会。原来Windows下的做法是首先发送获取64字节的设备描述符请求，如果端点0的最大数据包长度是32或64，设备只需要将18字节的设备描述符全部返回即可，但是如果端点0的最大数据包长度是8或16，而设备描述符长度是18字节，不能一次性传完，那么没有关系，对设备做一次reset，清除本次控制传输，由于前面已经得到了端点0的最大数据包长度，那么后面同样以最大数据包长度来通信，这就是Windows下的做法。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/23/DFT%E6%A0%85%E6%A0%8F%E6%95%88%E5%BA%94%E4%B9%8Bpython%E4%BE%8B%E5%AD%90/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/23/DFT%E6%A0%85%E6%A0%8F%E6%95%88%E5%BA%94%E4%B9%8Bpython%E4%BE%8B%E5%AD%90/" class="post-title-link" itemprop="url">DFT栅栏效应之python例子</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-23 13:26:51" itemprop="dateCreated datePublished" datetime="2021-04-23T13:26:51+08:00">2021-04-23</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2021/04/23/DFT%E6%A0%85%E6%A0%8F%E6%95%88%E5%BA%94%E4%B9%8Bpython%E4%BE%8B%E5%AD%90/" class="post-meta-item leancloud_visitors" data-flag-title="DFT栅栏效应之python例子" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/23/DFT%E6%A0%85%E6%A0%8F%E6%95%88%E5%BA%94%E4%B9%8Bpython%E4%BE%8B%E5%AD%90/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/23/DFT%E6%A0%85%E6%A0%8F%E6%95%88%E5%BA%94%E4%B9%8Bpython%E4%BE%8B%E5%AD%90/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="栅栏效应"><a href="#栅栏效应" class="headerlink" title="栅栏效应"></a>栅栏效应</h3><p>​    在计算N点的DFT时，输出的N个点相当于对信号频谱进行了N点等间隔采样。这个采样间隔为：delta_f = fs / N</p>
<ul>
<li>其中fs为采样频率，N为采样点数。</li>
</ul>
<ul>
<li><p>如果输入信号中有两个信号，其频率间隔小于delta_f，那么DFT的输出将不能分辨出这个两个信号的频谱，这个现象就是栅栏效应。</p>
<p>解决栅栏效应的办法是增大N至delta_f小于信号之间的最小频率间隔。</p>
</li>
</ul>
<h2 id="例子"><a href="#例子" class="headerlink" title="例子"></a>例子</h2><p>​    假设信号如下所示：y = sin(2<em>pi</em>5<em>t) + sin(2</em>pi<em>5.04</em>t)</p>
<p>​    这个信号的由两个信号组成，一个频率为5Hz, 另一个的频率为5.04Hz。这两个信号的频率差为0.04Hz。<br>我们取采样频率fs=100，当N=100, delta_f=1 Hz, 不能分辨出这两个信号。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210423131554.png" style="zoom:67%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210423131741.png" style="zoom:50%;">

<p>​    当把N增加到10000时，delta_f=0.01 Hz，可以分辨出这个信号：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210423132523.png" style="zoom:67%;">
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/23/SciPy%E4%BD%BF%E7%94%A8FFTpack%E5%81%9A%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/23/SciPy%E4%BD%BF%E7%94%A8FFTpack%E5%81%9A%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" class="post-title-link" itemprop="url">SciPy使用FFTpack做傅立叶变换</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-23 11:34:19" itemprop="dateCreated datePublished" datetime="2021-04-23T11:34:19+08:00">2021-04-23</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2021/04/23/SciPy%E4%BD%BF%E7%94%A8FFTpack%E5%81%9A%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" class="post-meta-item leancloud_visitors" data-flag-title="SciPy使用FFTpack做傅立叶变换" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/23/SciPy%E4%BD%BF%E7%94%A8FFTpack%E5%81%9A%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/23/SciPy%E4%BD%BF%E7%94%A8FFTpack%E5%81%9A%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    SciPy提供了fftpack模块, 该模块用于计算傅立叶变换，另外numpy中也提供了计算傅立叶变换的函数。比如numpy.fft.fft(x, n = 10) 和 scipy.fftpack.fft(x, n = 10)两者的结果完全相同。其中，第一个参数x表示输入的序列，第二个参数n表示制定FFT的点数，n值如果没有的话，那么就默认输入序列的个数为FFT的点数 。两者虽然相同，但是scipy.fftpack.fft的效率更高，推荐优先使用。</p>
<p>​    <strong>在画频谱图的时候，要给出横坐标的数字频率，这里可以用fftfreq给出</strong>，对于fftfreq的说明如下：scipy.fftpack.fftfreq(n, d=1.0)，第一个参数n是FFT的点数，一般取FFT之后的数据的长度（size）第二个参数d是采样周期，其倒数就是采样频率Fs，即d=1/Fs。</p>
<p>​    需要说明的是，DFT变换中，<strong>频率的分辨率为Fs/n=1/d*n</strong>    (在博文:<a target="_blank" rel="noopener" href="https://xudonglei.gitee.io/2021/04/07/%E6%9C%BA%E6%A2%B0%E6%8C%AF%E5%8A%A8FFT%E9%A2%91%E8%B0%B1%E5%88%86%E6%9E%90/">https://xudonglei.gitee.io/2021/04/07/%E6%9C%BA%E6%A2%B0%E6%8C%AF%E5%8A%A8FFT%E9%A2%91%E8%B0%B1%E5%88%86%E6%9E%90/</a> 也有提到)</p>
<p>​    fftfreq得到的结果为各个数字频率 ：k*<em>Fs/n = k/d**</em>n</p>
<p>​    下面直接看代码:</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210423113123.png" style="zoom:67%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/Figure_1.png" style="zoom:87%;">
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/21/MM32%E7%A8%8B%E5%BA%8F%E5%8D%A1%E6%AD%BB%E5%9C%A8B.%20ENDP/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/04/21/MM32%E7%A8%8B%E5%BA%8F%E5%8D%A1%E6%AD%BB%E5%9C%A8B.%20ENDP/" class="post-title-link" itemprop="url">MM32程序卡死在B. ENDP</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-21 17:29:20" itemprop="dateCreated datePublished" datetime="2021-04-21T17:29:20+08:00">2021-04-21</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2021/04/21/MM32%E7%A8%8B%E5%BA%8F%E5%8D%A1%E6%AD%BB%E5%9C%A8B.%20ENDP/" class="post-meta-item leancloud_visitors" data-flag-title="MM32程序卡死在B. ENDP" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/21/MM32%E7%A8%8B%E5%BA%8F%E5%8D%A1%E6%AD%BB%E5%9C%A8B.%20ENDP/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/21/MM32%E7%A8%8B%E5%BA%8F%E5%8D%A1%E6%AD%BB%E5%9C%A8B.%20ENDP/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    在调试MM32程序的时候，程序卡死在下图这个地方：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/死在了这个地方.png" style="zoom:67%;">

<p>原因是使能了某个中断，但是没有写对应的中断入口函数，中断后无法找到中断入口函数造成错误。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/23/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/23/">23</a><span class="page-number current">24</span><a class="page-number" href="/page/25/">25</a><span class="space">&hellip;</span><a class="page-number" href="/page/29/">29</a><a class="extend next" rel="next" href="/page/25/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
